AccountBook

AccountBook is the overall container for a data file in Moneydance. It contains references to all transactions, accounts, currencies, securities, budgets, etc.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
lateinit var addresses: AddressBook
Link copied to clipboard
Link copied to clipboard
lateinit var budgets: BudgetList
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The set of currencies associated with this file

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Returns true if the current file has been created from a sync source but has not yet retrieved a full copy of the data set.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Returns an object that can be used to save information locally, such as preferences, network/syncing settings, and passwords (if the data file is encrypted). Note: data put into the local storage is not synced.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
lateinit var onlineInfo: OnlineInfo
Link copied to clipboard
Link copied to clipboard

Tells the model whether all account balances should be recalculated whenever a transaction is modified. For performance reasons this should be set to false before adding/modifying/deleting a bunch of transactions and then set to true afterwards. DON'T FORGET TO SET TO TRUE WHEN DONE WITH THE OPERATION!!!!

Link copied to clipboard
lateinit var reminders: ReminderSet
Link copied to clipboard
Link copied to clipboard
var syncer: Syncer?

Get the syncer associated with this data set, if any.

Link copied to clipboard
Link copied to clipboard

Get the set of all transactions.

Link copied to clipboard

The undo manager that is associated with the data file, if one has been set by the UI

Functions

Link copied to clipboard

add a listener to be notified when an account is modified.

Link copied to clipboard

Add a file listener, but only if it is not already listening for file events in this AccountBook

Link copied to clipboard

Add a listener to this AccountBook, but only if it is not already in the list of listeners

Link copied to clipboard
fun cleanUp()

Avoid lapsed listener leaks when successively opening multiple files. Clean up all fields that have back references to this object, and remove any listeners that were not already removed.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun doInitialLoad(isSyncMaster: Boolean)

Load the set of accounts from storage

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
fun fixDuplicateRoots(revalidateIfChanged: Boolean = true)
Link copied to clipboard
fun getAccountByNum(acctNum: Int): Account?
Link copied to clipboard
Link copied to clipboard

Lookup an account by either it's old account ID (if given a numeric value) or by it's UUID.

Link copied to clipboard
Link copied to clipboard

Returns the local item that has the given ID

Link copied to clipboard
fun getItemsWithType(type: String): List<SyncableItem>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
Link copied to clipboard
fun initializeAccounts(rootAccount: Account)
Link copied to clipboard
fun initializeNewEmptyAccounts(defaultCurrencyID: String)
Link copied to clipboard

Record that the given item was changed, so that the change can be saved and synced.

Link copied to clipboard

Record that the given items were changed, so that the changes can be saved and synced.

Link copied to clipboard

Record that the given item was removed, so that the removal of the item can be synced.

Link copied to clipboard
Link copied to clipboard
fun moveToFolder(newFolder: File)

Move this account book to the given base folder. This is used for internal functions such as moving a provisional set of data from a temporary folder into it's permanent location.

Link copied to clipboard
fun notifyAccountAdded(parent: Account?, newAccount: Account?)

notify all listeners that the specified account has been added.

Link copied to clipboard
fun notifyAccountDeleted(parent: Account?, deletedAcct: Account?)

notify all listeners that the specified account has been deleted.

Link copied to clipboard

notify all listeners that the specified account has been modified.

Link copied to clipboard

notify all listeners that a balance in the specified account has changed.

Link copied to clipboard
fun notifySyncingUpdated(syncStatus: SyncStatus)
Link copied to clipboard
Link copied to clipboard

Validates the AccountBook's data structure, including account hierarchy, presence of a single root account, currency snapshot references, and more. This will skip some checks if isFinishedInitialLoad is false, because it means the entire data set is not yet loaded and automatic corrections shouldn't be made. So the file loader should ensure that this method is called at least once after isFinishedInitialLoad is set to true.

Link copied to clipboard
Link copied to clipboard

enqueue this object to be stored and synced, but don't save/sync it immediately because changes are likely right around the corner.

Link copied to clipboard

This will update the accounts balance from the "working" value and notify listeners if the balance has changed. Returns true if any of the balances have changed.

Link copied to clipboard
Link copied to clipboard
fun registerNewItemWithoutSyncing(newItem: SyncableItem)

Call this to add an item to the data set that is not yet synced. This should only be called when loading data in bulk. After this is called you should push a new trunk data set to the syncing system so that this item is not lost!

Link copied to clipboard

remove the specified object so that it doesn't get any more notifications when an account is modified.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun replaceRootAccount(newRootAccount: Account?)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun save(): Boolean

Save any pending queued changes, returning false if we couldn't save something

Link copied to clipboard

Saves a snapshot of the current data set in a "trunk" data file. If the resetTxnQueue parameter is true then any incremental transaction logs since the last save are wiped out. Therefore, the parameter should only be true if we're the master syncing node AND ve created a new data file for the first time or we want to reset the transaction queue for some other reason.

Link copied to clipboard
fun setRootAccount(newRootAccount: Account)
Link copied to clipboard
fun startSyncing(syncFolder: SyncFolder, callback: SyncDelegate?, isMasterSyncer: Boolean)

If the syncing process hasn't already been established then this synchronously downloads the initial data set. It then kicks off a background thread to continuously sync this data file. If syncing has already started this does nothing.

Link copied to clipboard
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard